package com.tianpengtech.common.util;

public class PageUtil {

	/**
	 * 截取字符串
	 * @param content
	 * @param maxLength
	 * @return
	 */
	public static String maxLength(String content,int maxLength){
		String result ="暂无最新消息";
		if(isTooLong(content, maxLength)){
			result = content.substring(0, maxLength);
			result = result+"...";
		}
		return result;
	}
	
	public static boolean isTooLong(String content,int maxLength){
		String result = (content==null)?"":content;
		return result.length()> maxLength;
	}
	
	public static String includePage(String template){
		return "../../../../"+template+"/index.html";
	}
}
